package com.uduemc.biso.module.basic.service.common.controller;

import javax.validation.Valid;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.uduemc.biso.core.common.dto.CBNodemanageSiteList;
import com.uduemc.biso.core.common.extities.CHostData;
import com.uduemc.biso.core.utils.RestResult;
import com.uduemc.biso.module.basic.service.common.service.CHostService;

/**
 * 站点管理服务的提供者
 * 
 * @author guanyi
 *
 */
@RestController
@RequestMapping("/common/host")
public class CHostController {

	private final static Logger logger = LoggerFactory.getLogger(CHostController.class);

	@Autowired
	private CHostService cHostServiceImpl;

	/**
	 * 获取站点信息数据列表
	 * 
	 * @return
	 */
	@PostMapping("/list-infos")
	public RestResult findListInfos(@Valid @RequestBody CBNodemanageSiteList cBNodemanageSiteList) {
		logger.debug(cBNodemanageSiteList.toString());
		PageInfo<CHostData> findListInfos = cHostServiceImpl.findListInfos(cBNodemanageSiteList);
		return RestResult.ok(findListInfos);
	}

}
